import java.util.Iterator;
import java.util.Vector;

/**
 * 
 */

/**
 * @author aad1554
 *
 */
public class LaneReport {

	/**
	 * Emails and prints out a report about a bowling game.
	 * 
	 * @param printVector
	 * @param scoreIt
	 * @param finalScores
	 * @param gameNumber
	 */
	public static void sendScoreReport(Vector printVector, Iterator scoreIt,
			int[][] finalScores, int gameNumber) {
		int myIndex = 0;
		while (scoreIt.hasNext()){
			Bowler thisBowler = (Bowler)scoreIt.next();
			ScoreReport sr = new ScoreReport( thisBowler, finalScores[myIndex++], gameNumber );
			sr.sendEmail(thisBowler.getEmail());
			Iterator printIt = printVector.iterator();
			while (printIt.hasNext()){
				if (thisBowler.getNick() == (String)printIt.next()){
					System.out.println("Printing " + thisBowler.getNick());
					sr.sendPrintout();
				}
			}

		}
		
	}}
